package cn.com.zj.rpc.controller;

import cn.com.zj.rpc.factory.UserServiceFactory;
import cn.com.zj.rpc.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @ClassName UserController
 * @Description 用户controller
 * @Author ZikZ227412
 * @DATE 2021/12/10 14:37
 * @Version 1.0
 */
@RestController
@RequestMapping("/user")
public class UserController {


    @Autowired
    private UserServiceFactory userServiceFactory;


    @GetMapping("/findUserById/{userId}")
    public User findUserById(@PathVariable("userId") Integer userId){
        User user = userServiceFactory.getUserService().getById(userId);
        return user;
    }
}
